const mysql = require('mysql2/promise')
const config = require('./db')

async function getConnection() {
  return await mysql.createConnection({
    host: config.db.host,
    port: config.db.port,
    user: config.db.user,
    password: config.db.password,
    database: config.db.database
  })
}

module.exports = getConnection
